<?php

namespace app\controller;
use hg\apidoc\annotation as Apidoc;
use support\Request;

/**
 * @Apidoc\Title("基础示例")
 */
class IndexController
{
    /**
     * @Apidoc\Title("请求Query参数")
     * @Apidoc\Method("GET")
     * @Apidoc\Header("token", type="string",require=true, desc="Token")
     * @Apidoc\Query("id", type="int",require=true, desc="信息id")
     * @Apidoc\Returned("id", type="int", desc="信息id")
     */
    public function index(Request $request)
    {
        return response('hello webman');
    }

    public function view(Request $request)
    {
        return view('index/view', ['name' => 'webman']);
    }

    public function json(Request $request)
    {
        return json(['code' => 0, 'msg' => 'ok']);
    }

}
